﻿/*******************************************************************************
 * AAEngine
 * Copyright (c) 2010 Mike Jarosch
 *
 * Original source PushButton Engine:
 * Copyright (C) 2009 PushButton Labs, LLC
 * For more information see http://www.pushbuttonengine.com
 *
 * This file is licensed under the terms of the MIT license, which is included
 * in the "MIT License.txt" file at the root directory of this SDK.
 ******************************************************************************/

using Microsoft.Xna.Framework;

namespace AAEngine.Animation
{
    public class PointAnimator : Animator
    {
        protected override object DoEase(object start, object end, float elapsed, float duration)
        {
            Vector2 result = new Vector2();
            result.X = (float)Ease(((Vector2)start).X, ((Vector2)end).X - ((Vector2)start).X, elapsed, duration);
            result.Y = (float)Ease(((Vector2)start).Y, ((Vector2)end).Y - ((Vector2)start).Y, elapsed, duration);
            return result;
        }

        protected override object Interpolate(object start, object end, float time)
        {
            Vector2 result = new Vector2();
            result.X = (float)base.Interpolate(((Vector2)start).X, ((Vector2)end).X, time);
            result.Y = (float)base.Interpolate(((Vector2)start).Y, ((Vector2)end).Y, time);
            return result;
        }
    }
}
